*     *****************************************************************  * 
*     *****************************************************************  * 
*       File-Name:      aggregate.do                                     *  
*       Date:           1 June 2016                                      * 
*       Author:         Gschwend                                         * 
*       Purpose:      	aggregate country studies					     *
* 	    Input Files:    aggregated_*.dta                                 *
*       Data Output:    aggregate.dta                                    *              
*     ****************************************************************   * 
*     ****************************************************************   * 



version 14.2
clear
capture log close
set more off



**********************************************
* Specify your own local path to the dropbox *
**********************************************


* Thomas G.'s local (office) path:
* local path /Users/gschwend/Dropbox/Andre/OUP multilevel electoral behavior book/chapter 6/replication/


* Thomas G.'s local (Air) path:
* local path /Users/thomasgschwend/Dropbox/Andre/OUP multilevel electoral behavior book/chapter 6/replication/
 
 


*** Save variables for LowerSaxony at the Regional level

use "aggregated_GER.dta", clear

 append using "aggregated_Spain.dta"
 append using "aggregated_France.dta"

 
recode importance_regional 99= .
recode importance_national 99= .
recode importance_european 99= .

recode spid 9=.
recode pid 88/max=.


forval i = 1(1)9 {
	recode Q17_party`i' 99=.
}

compress
save "aggregate.dta", replace





